'''
# -*- coding:utf-8 -*-
# @Project: DevOps_api
# @Date: 2023/3/12 - 22:06
# @Author: ysg
# @Describe: 

Ops_responses.py
'''
from rest_framework.response import Response


class OpsResponse(Response):
    def __init__(self, code=100, msg='success', status=None, headers=None, **kwargs):
        result = {'code': code, 'msg': msg}
        if kwargs:
            result.update(kwargs)
        result['success'] = True if result['msg'] == 'success' else False
        super().__init__(data=result, status=status, headers=headers)
